/*
 * Copyright 2018 The JA-SIG Collaborative. All rights reserved.
 * distributed with thi file and available online at
 */
package com.lap.scp.erp.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.lap.scd.commons.page.Page;
import com.lap.scd.commons.page.PageResult;
import com.lap.scp.erp.ao.SalaryAO;
import com.lap.scp.erp.domain.ArtificialDO;
import com.lap.scp.erp.query.PaymentQueryVO;

/**
 * <pre>
 *
 * </pre>
 * 
 * @author 劳水生 Exp
 * @Date 2018年10月13日 下午5:24:37
 * @since 1.0
 */
@Controller
@RequestMapping("salary")
public class SalaryController {

	@Resource
	private SalaryAO salaryAO;

	/**
	 * <pre>
	 * 根据条件、分页信息查询工资信息
	 * </pre>
	 * 
	 * @param page
	 * @param queryVO
	 * @return
	 */
	@RequestMapping(value = "list", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView queryPage(Page page, PaymentQueryVO queryVO) {
		ModelAndView andView = new ModelAndView();
		PageResult<ArtificialDO> pr = salaryAO.queryPage(page, queryVO);
		if (pr.isSuccess()) {
			andView.setViewName("erp/salaryList");
			andView.addObject("queryVO", queryVO);
			andView.addObject("pr", pr);
		} else {
			andView.setViewName("error");
		}
		return andView;
	}
}
